<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
try
{
   String cityId=request.getParameter("cityId");
   if(cityId==null||cityId.equals(""))
   {
      cityId=session.getAttribute("cityId").toString();
      if(cityId==null||cityId.equals(""))
      {
        session.setAttribute("cityId",73);
      }else
      {
         session.setAttribute("cityId",cityId);
      }
   }else
   {
       session.setAttribute("cityId",cityId);
   }
}catch(Exception e)
{
 session.setAttribute("cityId",73);
}
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.head{width:960px;height:59px;background-attachment: scroll;background:url(../images/head.jpg) no-repeat left top;line-height: 59px; }
.head .nav{display:block; height:62px;margin-left:30px;}
.head .nav li{ }
.head a{font:bold 20px 微软雅黑;  line-height:59px; color:#9c2684;}
.top{width:960px; margin-top:20px;border-bottom:1px dotted #E7E7E7;}
.top ul{ height:20px;margin-left:30px;}
.top li{}
.top a{font:bold 14px 微软雅黑;  color:#9c2684;}
</style>
<script >
$(document).ready(function(){
	$("#cityBut").click(function(e){
	        if($("#city").css("display")=="none")
			{	
				$("#city").show();
				var X = $(this).position().top+17;
                var Y = $(this).position().left+10;
				$("#city").css({top:X+"px",left:Y+"px"});
			}else
			{
				$("#city").hide();
			}
	
    })
	
});
</script>
</head>

<body>
    
<div  style="margin-top:30px;">
   <s:if test="#session.user==null">
	<div class="head">
		<ul class="nav">
			<li style="float:left;margin-right:40px;"><a href="/" >首页</a></li>
			<li style="float:left;margin-right:40px;"><a href="groupby/groupby!oldGroupbyList.action?currentPage=1&cityId=<s:property value="#session.cityId"/>" target="_blank">往期团购</a></li>
			<li style="float:left;margin-right:40px;"><a href="user/brandPage" target="_parent">品牌</a></li>
			
			<s:if test="listDredgeCitys==null||listDredgeCitys.size()==0">
			    <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut">上海</a></li>
			    
			</s:if>
			<s:iterator value="listDredgeCitys" id="id" status="status">
			 <s:if test="#session.cityId==id">
			   
			   <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut"><s:property value="name"/></a></li>
			  
			 </s:if>
			</s:iterator>
			<li style="float:right; margin-right: 20px;"><a href="register.jsp" target="_parent">注册</a></li>
			<li style="float:right; margin-right: 20px;"><a href="login.jsp" target="_parent">登陆</a></li>
		</ul>
		<div class="clear"></div>
	</div>
    </s:if>
    <s:if test="#session.user.level==1">
	<div class="head">
		<ul class="nav">
			<li style="float:left;margin-right:40px;"><a href="welcome.jsp" >首页</a></li>
			<li style="float:left;margin-right:40px;"><a href="groupby/groupby!oldGroupbyList.action?currentPage=1&cityId=<s:property value="#session.cityId"/>" target="_blank">往期团购</a></li>
			<li style="float:left;margin-right:40px;"><a href="user/user!brandPage.action?currentPage=1" target="_parent">品牌</a></li>
			<s:if test="listDredgeCitys==null||listDredgeCitys.size()==0">
			    <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut">上海</a></li>
			</s:if>
			<s:iterator value="listDredgeCitys" id="id" status="status">
			 <s:if test="#session.cityId==id">
			   <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut"><s:property value="name"/></a></li>
			 </s:if>
			</s:iterator>
			<li style="float:right; margin-right: 20px;"><a href="user!loginOut.action">退出</a></li>
			<li style="float:right; margin-right: 20px;"><a href="admin/admin.jsp" ><s:property value='#session.user.email'/>的设置</a></li>
		</ul>
		<div class="clear"></div>
	</div>
    </s:if>
    <s:elseif test="#session.user.level==2">
        <div class="top">
		<ul >
			<li style="float:left;margin-right:40px;"><a href="welcome.jsp" >首页</a></li>
			<li style="float:left;margin-right:40px;"><a href="groupby/groupby!oldGroupbyList.action?currentPage=1&cityId=<s:property value="#session.cityId"/>" target="_blank">往期团购</a></li>
			<li style="float:left;margin-right:40px;"><a href="user/user!brandPage.action?currentPage=1" target="_parent">品牌</a></li>
			
			<s:if test="listDredgeCitys==null||listDredgeCitys.size()==0">
			    <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut">上海</a></li>
			   
			</s:if>
			<s:iterator value="listDredgeCitys" id="id" status="status">
			 <s:if test="#session.cityId==id">
			   <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut"><s:property value="name"/></a></li>
			   
			 </s:if>
			</s:iterator>
			<li style="float:right;margin-right:20px;"><a href="user!loginOut.action">退出</a></li>
			<li style="float:right; margin-right: 20px;">
			   <a href="admin/admin.jsp" >
			    <s:if test="#session.userDetial.username!=''">
			        <s:property value='#session.userDetial.username'/>
				</s:if>
				<s:elseif test="#session.userDetial.eusername!=''">
				    <s:property value='#session.userDetial.eusername'/>
				</s:elseif>
				<s:else>
				    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
				</s:else>
			   的设置
			   </a>
			 </li>
			 
			
		</ul>
	</div>
	<div class="head">
		<ul class="nav">
			<li style="float:left; margin-right: 20px;"><a href="user/user!singleUserPage.action?userId=<s:property value='#session.user.id'/>&currentPage=1" >
			<s:if test="#session.userDetial.username!=''">
			        <s:property value='#session.userDetial.username'/>
				</s:if>
				<s:elseif test="#session.userDetial.eusername!=''">
				    <s:property value='#session.userDetial.eusername'/>
				</s:elseif>
				<s:else>
				    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
				</s:else>
			
			的主页</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!dynamicList.action?currentPage=1&userId=<s:property value='#session.user.id'/>" target="_parent">动态</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!brandUserList.action?currentPage=1&userId=<s:property value='#session.user.id'/>" target="_parent">品牌</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">友邻</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!feedBack.action?currentPage=1&userId=<s:property value="#session.user.id"/>" target="_parent">留言</a></li>
		</ul>
		<div class="clear"></div>
    </s:elseif>
    <s:elseif test="#session.user.level==3">
     <div class="top">
		<ul >
			<li style="float:left;margin-right:40px;"><a href="welcome.jsp" >首页</a></li>
			<li style="float:left;margin-right:40px;"><a href="groupby/groupby!oldGroupbyList.action?currentPage=1&cityId=<s:property value="#session.cityId"/>" target="_blank">往期团购</a></li>
			<li style="float:left;margin-right:40px;"><a href="user/user!brandPage.action?currentPage=1" target="_parent">品牌</a></li>
			<s:if test="listDredgeCitys==null||listDredgeCitys.size()==0">
			    <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut">上海</a></li>
			</s:if>
			<s:iterator value="listDredgeCitys" id="id" status="status">
			 <s:if test="#session.cityId==id">
			   <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut"><s:property value="name"/></a></li>
			 </s:if>
			</s:iterator>
			<li style="float:right;margin-right:20px;"> <a href="user!loginOut.action">退出</a></li>
			<li style="float:right;margin-right:20px;">
			   <a href="admin/admin.jsp" style="margin-right:35px;">
			   <s:if test="#session.userDetial.username!=''">
			    <s:property value='#session.userDetial.username'/>
			</s:if>
			<s:elseif test="#session.userDetial.eusername!=''">
			    <s:property value='#session.userDetial.eusername'/>
			</s:elseif>
			<s:else>
			    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
			</s:else>
			的设置
			   </a>
			 </li>
			 
		</ul>
	</div>
	<div class="head">
		<ul class="nav">
			<li style="float:left; margin-right: 20px;"><a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value='#session.user.id'/>" >
			<s:if test="#session.userDetial.username!=''">
			    <s:property value='#session.userDetial.username'/>
			</s:if>
			<s:elseif test="#session.userDetial.eusername!=''">
			    <s:property value='#session.userDetial.eusername'/>
			</s:elseif>
			<s:else>
			    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
			</s:else>
			的主页
			</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!myGroupby.action?currentPage=1&userId=<s:property value='#session.user.id'/>" target="_parent">团购</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!myOldGroupby.action?currentPage=1&userId=<s:property value='#session.user.id'/>" target="_parent">往期团购</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">友邻</a></li>
			<li style="float:left; margin-right: 20px;"><a href="user/user!myCriticism.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">评论</a></li>
		</ul>
		<div class="clear"></div>
    </s:elseif>
    <s:elseif test="#session.user.level==4">
      <div class="top">
		<ul >
			<li style="float:left;margin-right:40px;"><a href="welcome.jsp" >首页</a></li>
			<li style="float:left;margin-right:40px;"><a href="groupby/groupby!oldGroupbyList.action?currentPage=1&cityId=<s:property value="#session.cityId"/>" target="_blank">往期团购</a></li>
			<li style="float:left;margin-right:40px;"><a href="user/user!brandPage.action?currentPage=1" target="_parent">品牌</a></li>
			<s:if test="listDredgeCitys==null||listDredgeCitys.size()==0">
			    <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut">上海</a></li>
			   
			</s:if>
			<s:iterator value="listDredgeCitys" id="id" status="status">
			 <s:if test="#session.cityId==id">
			   <li style="float:left;margin-right:40px;"><a href="javascript:void(0)" id="cityBut"><s:property value="name"/></a></li>
			  
			 </s:if>
			</s:iterator>
			 <li style="float:right;margin-right:20px;"><a href="user!loginOut.action">退出</a></li>
			<li style="float:right;margin-right:20px;">
			   <a href="admin/admin.jsp" style="margin-right:35px;">
			   <s:if test="#session.userDetial.username!=''">
			    <s:property value='#session.userDetial.username'/>
			</s:if>
			<s:elseif test="#session.userDetial.eusername!=''">
			    <s:property value='#session.userDetial.eusername'/>
			</s:elseif>
			<s:else>
			    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
			</s:else>
			的设置
			</a>
			   
			 </li>
			
		</ul>
	</div>
	<div class="head">
		<ul class="nav">
			<li style="float:left;margin-right:20px;"><a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value='#session.user.id'/>" >
			<s:if test="#session.userDetial.username!=''">
			    <s:property value='#session.userDetial.username'/>
			</s:if>
			<s:elseif test="#session.userDetial.eusername!=''">
			    <s:property value='#session.userDetial.eusername'/>
			</s:elseif>
			<s:else>
			    <s:property value='#session.user.email.substring(0,#session.user.email.indexOf("@"))'/>
			</s:else>
			的主页
			
			</a></li>
			<li style="float:left;margin-right:20px;"><a href="user/branduser!picturesList.action?currentPage=1&userId=<s:property value='#session.user.id'/>" target="_parent">相册</a></li>
			<li style="float:left;margin-right:20px;"><a href="user/branduser!brandInforAllList.action?currentPage=1&userId=<s:property value="#session.user.id"/>" target="_parent">资讯</a></li>
			<li style="float:left;margin-right:20px;"><a href="user/branduser!topicList.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">论坛</a></li>
			<li style="float:left;margin-right:20px;"><a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">友邻</a></li>
			<li style="float:left;margin-right:20px;"><a href="user/user!myCriticism.action?currentPage=1&userId=<s:property value="#session.user.id"/>"  target="_parent">评论</a></li>
		</ul>
		<div class="clear"></div>
		
    </s:elseif>
</div>

<div id="city" style="z-index: 1999999;position:absolute;display:none;width:400px;height:300px;border:2px solid;border-color:#FAFAFA;background-color:#E8E8E8;">
                 
                  <table style="table-layout:fixed;font-size:16px;width:100%">
                    <tr style="background-color:#F1F6F6;text-align:center;">
                    <s:iterator value="listDredgeCitys" id="id" status="status">
                         <s:if test="#cityId==id">
                             <input type="hidden" id="cityId" value="<s:property value="name"/>">
                       </s:if>
                        <s:if test="(#status.index+1)%5==0">
                          <td style="border:1px solid #D9D9D9;color:black;padding:2px;"><a href="groupby!index.action?currentPage=1&cityId=<s:property value="id"/>" ><s:property value="name"/></a></td>
                           <s:if test="(#status.index+1)==listDredgeCitys.size()">
                                 </tr>
                             </s:if>
                             <s:else>
                                </tr><tr style="background-color:#F1F6F6;text-align:center;">
                             </s:else>
                        </s:if>
                        <s:else>
                           <td style="border:1px solid #D9D9D9;color:black;padding:2px;"><a href="groupby!index.action?currentPage=1&cityId=<s:property value="id"/>" ><s:property value="name"/></a></td>
                        </s:else>
                        <s:if test="(#status.index+1)==listDredgeCitys.size()">
                                 <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="1"/>
							       <s:param name="last" value="5-(listDredgeCitys.size()%5)" />
							       <s:iterator status="status"> 
							         <td style="border:1px solid #D9D9D9;color:black;padding:2px;">&nbsp;</td>
							       </s:iterator> 
							     </s:bean>
                               </tr>
                             </s:if>
                    </s:iterator>
                   
                   
                  </table>
                  
            </div>
</body>
</html>
